package com.canopys.study.open.opensource.sm.engine;

import com.canopys.study.open.opensource.sm.DemoStateMachine;
import com.canopys.study.open.opensource.sm.listener.DemoListener;
import com.canopys.study.open.opensource.sm.state.DemoState;
import org.springframework.stereotype.Service;

/**
 * @Author: Canopys
 * @Descrption:
 * @Date: Created in 11:03 2019/3/24
 * @Modified By:
 */
@Service
public class DemoStateMachineEngine extends AbstractStateMachineEngine<DemoStateMachine> {

    public DemoStateMachine newStateMachine(DemoState initState) {
        DemoStateMachine stateMachine = stateMachineBuilder.newUntypedStateMachine(initState);
        stateMachine.addDeclarativeListener(new DemoListener());
        return stateMachine;
    }
}
